In [2]:
7**4+4
Out[2]:
In [1]:
5+7**5
Out[1]:
In [8]:
import sympy as sp
from matplotlib import pyplot as plt
%matplotlib inline
# Customize figure size
plt.rcParams['figure.figsize'] = 25, 15
#plt.rcParams['lines.linewidth'] = 1
#plt.rcParams['lines.color'] = 'g'
plt.rcParams['font.family'] = 'monospace'
plt.rcParams['font.size'] = '16.0'
plt.rcParams['text.hinting'] = 'either'
f = lambda x: 1/(x + 7**x)
sp.mpmath.plot([f], xlim=[-5,25], ylim=[0,25], points=500)
# To check your work, use Sympy.mpmath.nsum()
# This gives the sum of the infinite series (if the series converges)
infty = sp.mpmath.inf
sum = sp.mpmath.nsum(f, [1, infty])
print('The sum of the series = {}'.format(sum))
Let $a_n = \sum_{n=1}^{\infty} \frac{1}{n + 7^n}$.
Could $a_n$ be a Combination of Series (i.e. the sum of two series)?
In [9]:
f = lambda x: 1/x
g = lambda x: 1/7**x
sp.mpmath.plot([f,g], xlim=[-5,25], ylim=[0,25], points=500)
# Check that sum of f_n plus g_n = a_n
sum = sp.mpmath.nsum(f, [1, infty]) + sp.mpmath.nsum(g, [1, infty])
print('The sum of the series = {}'.format(sum))
In [ ]: